<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>实勘</title>
    <link rel="stylesheet" href="../../css/weui.css">
    <link rel="stylesheet" href="../../css/amazeui.css">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />

</head>
<style>
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body,
    html {
        width: 100%;
        background: #ececec;
    }

    header {
        text-align: center;
        height: 44px;
        line-height: 44px;
        position: relative;
    }

    .button {
        width: 80%;
        margin: 30px auto;
        display: block;
        outline: none;
    }


    .am-input-group-label {
        background: #fff;
        border: none;
        font-size: 12px;
        color: #9a9a9a
    }

    .am-form-field {
        border: none;
        text-align: right;
        outline: none;
        padding-right: 16px;
    }

    .am-input-group {
        position: relative
    }


    .weui-picker__action {
        color: #0e90d2;
    }

    .am-form-field {
        color: #000;
    }

    .xinxiTitle {
        padding: 0px 12px;
        margin-top: 5px;
        height: 38px;
        line-height: 38px;
        background: #fff;
    }

    .xinxibox {
        background: #FFF;
        padding: 10px;
    }

    .xinxiTITLE_2 {
        padding: 0 12px;
        height: 38px;
        line-height: 38px;
        background: transparent;
        margin-bottom: 10px;
    }

    .am-checkbox-inline+.am-checkbox-inline,
    .am-radio-inline+.am-radio-inline {
        margin: 0
    }

    .am-btn-primary {
        border-radius: 8px;
    }

    #bianhao{
        font-size: 12px;
    }
    .button {
            width: 90%;
            margin: 30px auto;
            display: block;
            outline: none;
            background: #1197ff;
            border-radius: 5px;
            height: 40px;
        }
</style>

<body>
        <!-- <div class="shenhe" style="
        width: 60px;
    height: 60px;
    position: fixed;
    right: 10px;
    bottom: 10px;
    background: #1197ff;
    font-size: 13px;
    border-radius: 100%;
    text-align: center;
    line-height: 60px;
    color: #fff;
    z-index: 9999;
    border: 1px solid #1284dc;
    ">
        提交审核
    </div> -->
    <div data-am-widget="tabs"  style="margin:0;background: #FFF;" class="box am-tabs am-tabs-default">
            <ul style="background: #FFF;" class="am-tabs-nav am-cf">
                <li onclick="window.location.href='./dingdanxinxi.html?id='+GetQueryString('id')+'&SerialNumber='+GetQueryString('SerialNumber')" class="">
                    <a href="javascript:;">订单详情</a>
                </li>
                <li onclick="window.location.href='./diyaxinxi.html?id='+GetQueryString('id')+'&SerialNumber='+GetQueryString('SerialNumber')" class="">
                    <a href="javascript:;">抵押信息</a>
                </li>
                <li onclick="window.location.href='./daikuanxinxi.html?id='+GetQueryString('id')+'&SerialNumber='+GetQueryString('SerialNumber')" class="">
                    <a href="javascript:;">贷款信息</a>
                </li>
                <li onclick="window.location.href='./diaochazongshu.html?id='+GetQueryString('id')+'&SerialNumber='+GetQueryString('SerialNumber')" class="am-active">
                    <a href="javascript:;">调查综述</a>
                </li>
                <li onclick="window.location.href='./zhaopian.html?id='+GetQueryString('id')+'&SerialNumber='+GetQueryString('SerialNumber')" class="">
                    <a href="javascript:;">照片</a>
                </li>
            </ul>
        </div>
    <div class="xinxiTitle " id="bianhao">
        订单编号：HD201802032268
    </div>
    <div class="xinxiTITLE_2">
        调查综述
    </div>
    <div class="xinxibox">
        <div style="padding: 5px 12px;margin: 0;" class="am-form-group">
            <label for="doc-ta-1">其他未尽事宜和风控下户人员初审意见：</label>
            <textarea name="review" style="width: 100%;resize:none;border-radius: 10px;outline: none;padding:5px;height: 12em;" class="inpu" rows="12" id="doc-ta-1"></textarea>
        </div>
    </div>
    <div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">提示</div>
            <div class="am-modal-bd cont">
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn">确定</span>
            </div>
        </div>
    </div>
    <button class="button am-btn am-btn-primary">提交</button>
    <div class="shenhe" style="
    width: 90%;
    margin: 30px auto;
    display: block;
    outline: none;
    background: #1197ff;
    border-radius: 5px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    color: #fff;
">
    提交审核
</div>
    <script src="../../js/jquery-3.2.1.min.js"></script>
    <script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
    <script src="../../js/amazeui.js"></script>
    <script>
                    function GetQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]);
                return null;
            }
        $(function () {
            var SerialNumber = localStorage.getItem('SerialNumber')
            var http = localStorage.getItem('http')
            var zhi = localStorage.getItem('zhi')
            var UserId = localStorage.getItem('UserId')
            var Access_token = localStorage.getItem('Access_token')
            var Refresh_token = localStorage.getItem('Refresh_token');
            $.ajax({
            type: 'GET',
            url: http + '/api/prosprct/GetAllOrderMes',
            headers: {
                "Authorize": Access_token + '|' + Refresh_token
            },
            data: {
                keyValue: zhi
            },
            success: function (data) {
                console.log(JSON.stringify(data));
                console.log(Object.keys(data.resultdata));
                dataarr = Object.keys(data.resultdata)
                for (var datakeys = 0; datakeys < Object.keys(data.resultdata).length; datakeys++) {

                    $("textarea").val(data.resultdata.Review)
                }
            },
            error: function (err) {
                alert('获取数据失败')
                console.log(JSON.stringify(err));
            }
        })
 
        $('#bianhao').text('订单编号：' + SerialNumber)
            $('.button').click(function () {
                $('.button').attr('disabled', 'true');
                var inpu = $('.inpu').val()
                console.log(inpu)
                if (!inpu) {
                    $(".cont").text('请填写信息')
                    $('#my-alert').modal('open')
                    $('.button').removeAttr('disabled')
                    return
                }
                console.log(inpu)
                $.ajax({
                    url: http + '/api/prosprct/SaveReview?keyWord='+zhi,
                    type: "POST",
                    headers: {
                        "Authorize": Access_token + '|' + Refresh_token,
                        "MemberId": UserId
                    },
                    data:{
                        review:inpu
                    },
                    dataType:'json',
                    // contentType:'json',
                    success: function (data) {
                        console.log(JSON.stringify(data))
                        $(".cont").text(data.message)
                        $('#my-alert').modal('open')
                        $('.button').removeAttr('disabled')

                    },
                    error: function (err) {
                        console.log(JSON.stringify(err))
                        $('.button').removeAttr('disabled')
                    }
                })
            })
        })

        
    $('.shenhe').on('click', function () {
                $.ajax({
                    type: 'POST',
                    url: http + '/api/prosprct/SaveExploitation?keyWord='+zhi,
                    headers: {
                        "Authorize": Access_token + '|' + Refresh_token
                    },
                    data: {},
                    success: function (data) {
                        console.log(JSON.stringify(data));
                        alert(data.message)
                        if (data.type==1) {
                            window.location.replace("../dingfan.html")
                        }
                    },
                    error: function (err) {
                        console.log(JSON.stringify(err));
                    }
                })
            })
    </script>
</body>

</html>